import os
import glob
from distutils.core import setup


data_files=[
    ('/usr/local/etc/rc.d', ['autobbotd/buildbot', 'buildbotweb/bbweb']),
    ('/usr/local/share/autobbotd', ['autobbotd/buildbotdb'])
]
for root, dirs, files in os.walk('buildbotweb/templates', topdown=True):
    dirs.remove('.svn')
    newfiles = map((lambda x: os.path.join(root, x)), files)
    data_files.append((os.path.join('/','usr','local','share', root), newfiles))

setup(
    name="BuildBot",
    version="0.1",
    description="BuildBot",
    author="Matt Kubilus",
    packages=[
        "autobbotd", "buildbotweb",
        os.path.join("buildbotweb","buildbot")
    ],
    package_data={'autobbotd': ['testdata/*'],'buildbotweb':[ 'media/css/*', 'media/js/plotkit/*', 'media/js/MochiKit/*', 'media/images/*']},
    scripts=[
        "autobbotd/buildbot",
        "buildbotweb/buildbotweb",
        "buildbotweb/bbmanage"
    ],
    data_files=data_files

)
